public class ChargingPlanModel extends Object implements XMLMarshallable, ContextualNode
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="chargingPlan">
<xs:complexType>
<xs:sequence>
<xs:element ref="usageCharge" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="recurringCharge" minOccurs="0" maxOccurs="1"/>
<xs:element ref="oneshotCharge" minOccurs="0" maxOccurs="1"/>
<xs:element ref="defaultCharge" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
</xs:complexType>
</xs:element>
| Constructor and Description |
|---|
ChargingPlanModel()
Creates an empty charging plan.
|
ChargingPlanModel(String name,
String description)
Creates an empty charging plan with a name and a description.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
void |
addUsageCharge(UsageChargeModel usageCharge)
Adds a usage charge and returns the old one which has the same name.
|
boolean |
checkValidity()
Check the validity of the charging plan.
|
RatingContextDescription |
getContext(ContextualNode child)
Gets the context description for the specified child;
The context description contains all the context properties.
|
DefaultChargeModel |
getDefaultCharge()
Gets the default charge of the charging plan.
|
String |
getDescription()
Gets the description of the charging plan.
|
String |
getName()
Gets the name of the charging plan.
|
OneShotChargeModel |
getOneShotCharge()
Gets the one-shot charge.
|
PricePlanModel |
getParent()
Gets the price plan parent.
|
RecurringChargeModel |
getRecurringCharge()
Gets the recurring charge.
|
UsageChargeModel |
getUsageCharge(String usageChargeName)
Returns the usage charge corresponding to the name of the usage charge.
|
List<UsageChargeModel> |
getUsageCharges()
Gets a list of all usage charge.
|
boolean |
hasOnlyInternalChargingReferences()
Checks if the charging plan has only internal charging references.
|
RatingContextDescription |
inheritedContext()
Gets the inherited context;
The context description contains all the context properties.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
UsageChargeModel |
removeUsageCharge(int index)
Remove the usage charge at the index.
|
UsageChargeModel |
removeUsageCharge(String usageChargeName)
Remove the usage charge corresponding to the name.
|
void |
retreiveInternalChargingReferences(List<String> list)
Retrieve all the internal charging references defined in the charging plan.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setDefaultCharge(DefaultChargeModel defaultCharge)
Sets the default charge.
|
void |
setDescription(String description)
Sets the description of the charging plan.
|
void |
setName(String name)
Sets the name of the charging plan.
|
void |
setOneShotCharge(OneShotChargeModel oneShotCharge)
Sets the one-shot charge.
|
void |
setParent(ContextualNode parent)
Sets the parent node
|
void |
setRecurringCharge(RecurringChargeModel recurringCharge)
Sets the recurring charge.
|
public String getName()
public void setName(String name)
name - the nem of the charging plan.public String getDescription()
public void setDescription(String description)
description - the description of the charging plan.public UsageChargeModel getUsageCharge(String usageChargeName)
usageChargeName - the name of the usage charge.public void addUsageCharge(UsageChargeModel usageCharge)
usageCharge - the usage charge to add.public UsageChargeModel removeUsageCharge(String usageChargeName)
usageChargeName - the name of the usage charge.public UsageChargeModel removeUsageCharge(int index)
index - the index of the usage charge.public List<UsageChargeModel> getUsageCharges()
public DefaultChargeModel getDefaultCharge()
DefaultChargeModelpublic void setDefaultCharge(DefaultChargeModel defaultCharge)
defaultCharge - the default chargeDefaultChargeModelpublic RecurringChargeModel getRecurringCharge()
RecurringChargeModelpublic void setRecurringCharge(RecurringChargeModel recurringCharge)
recurringCharge - the recurring charge.RecurringChargeModelpublic OneShotChargeModel getOneShotCharge()
OneShotChargeModelpublic void setOneShotCharge(OneShotChargeModel oneShotCharge)
oneShotCharge - the one-shot chargepublic void retreiveInternalChargingReferences(List<String> list)
list - the list of all the internal charging references defined in the charging plan.public boolean hasOnlyInternalChargingReferences()
public boolean checkValidity()
public PricePlanModel getParent()
public void setParent(ContextualNode parent)
ContextualNodesetParent in interface ContextualNodeparent - The parent nodepublic RatingContextDescription getContext(ContextualNode child)
ContextualNodegetContext in interface ContextualNodechild - The child nodepublic RatingContextDescription inheritedContext()
ContextualNodeinheritedContext in interface ContextualNodepublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into